import request from '@/utils/request'

// 完善商户信息
export function businessPerfection({ type, nickname, address, mobile, start_time, end_time }) {
    return request({
        url: '/business/perfection',
        method: 'post',
        data: {
            type,
            nickname,
            address,
            mobile,
            start_time,
            end_time
        }
    })
}

// 获取商家类型
export function businessGetType() {
    return request({
        url: '/business/get/type',
        method: 'get'
    })
}

// 获取商户商户赞助规则
export function businessGetRule() {
    return request({
        url: '/business/get/rule',
        method: 'get'
    })
}

// 商户添加奖项
export function businessPrizeSetting({ prize_1, prize_2, prize_3, rule, redeem_start, redeem_end, day, definite_day, amount }) {
    return request({
        url: '/business/prize/setting',
        method: 'post',
        data: {
            prize_1,
            prize_2,
            prize_3,
            rule,
            redeem_start,
            redeem_end,
            day,
            definite_day,
            amount
        }
    })
}

// 时间段列表接口
export function prizeValuation() {
    return request({
        url: '/business/prize/valuation',
        method: 'post'
    })
}

// 获取商户信息
export function businessGet() {
    return request({
        url: '/business/get/info',
        method: 'get'
    })
}

// 获取支付密钥接口
export function businessPay({ out_trade_no, amount }) {
    return request({
        url: '/business/pay',
        method: 'post',
        data: {
            out_trade_no,
            amount
        }
    })
}

